package com.sc.nft.admin.controller;

import com.sc.nft.admin.request.TaskPlanPageRequest;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.vo.TaskPlanRecordVO;
import com.sc.nft.service.TaskPlanService;
import com.sc.nft.sup.PageRequest;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/taskPlan")
@Api(tags="后台星球任务模块")
public class TaskPlanController {
    private final TaskPlanService taskPlanService;
    @PostMapping(value="/pageAdmin", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "分页获取星球任务记录",notes="分页获取星球任务记录", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<TaskPlanRecordVO> pageAdmin(@RequestBody TaskPlanPageRequest request){
        return PageResult.success(taskPlanService.pageAdmin(request.getUserTel(), request.getTaskName(), request.getStartTime(), request.getEndTime(), request.getPageNo(), request.getPageSize()));
    }
}
